#ifndef SINGLEDICTMODEL_H
#define SINGLEDICTMODEL_H

#include "universalquerymodel.h"

class SingleDictModel : public UniversalQueryModel
{
    Q_OBJECT

public:
    SingleDictModel(QString sqlTable, QObject *parent = 0);
    Qt::ItemFlags flags(const QModelIndex &index) const;
    QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
    void refresh();
    void sort(int column, Qt::SortOrder order);
    void filtrate(const QString &name);
    void setSqlTable(const QString &table);
    QString sqlTable() const;
private:
    QString fetchTableData(int column, Qt::SortOrder order);
    QString _sqlTable;
    QString filterText;
signals:
    void queryUpdated();
};

#endif // SINGLEDICTMODEL_H
